#ifndef DEXPANELBTN_H
#define DEXPANELBTN_H

#include <QPushButton>

#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>

class QContextMenuEvent;
class QDesktopWidget;

class DexPanelBtn : public QPushButton
	{
		Q_OBJECT

		public:
			DexPanelBtn(const QString &, QWidget * parent = 0);

			void setWindow(Window);

		protected:
			virtual void sendClientMessage(Atom, Window, long, long);
			virtual void contextMenuEvent(QContextMenuEvent*);
			virtual void mousePressEvent(QMouseEvent *);

		private:
			QMenu *menu;
			QAction *minimizeAction;
			QAction *restoreAction;
			Window win;

			void createMenu();

		private slots:
			void closeWindow();
			void minimize();
			void pressed(bool);
			void restore();
	};

#endif // DEXPANELBTN_H
